package cn.csg.iotplatform.module.system.mq.producer.dept;

import cn.csg.iotplatform.module.system.mq.message.dept.DeptProjectAttrChangeMessage;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

@Slf4j
@Component
public class DeptProjectAttrChangeProducer {

    @Resource
    private ApplicationContext applicationContext;

    public void sendDeptProjectAttrChangeMessage(boolean onlyDelete,List<Long> deptIds) {
        applicationContext.publishEvent(DeptProjectAttrChangeMessage.builder().onlyDelete(onlyDelete).deptIds(deptIds).build());
    }
}
